package org.lq.ht.service.impl;

import java.util.List;

import org.lq.ht.dao.DictionaryDao;
import org.lq.ht.dao.impl.DictionaryDaoImpl;
import org.lq.ht.entity.Dictionary;
import org.lq.ht.entity.TypeID;
import org.lq.ht.service.DictionaryService;

/**
 * 	字典业务层实现
 * @author 郑奥宇
 * @package org.lq.ht.service.impl
 * @date 2020年8月21日下午5:30:12
 */
public class DictionaryServiceImpl implements DictionaryService{
	DictionaryDao d = new DictionaryDaoImpl();
	/**
	 * 添加
	 */
	@Override
	public boolean saveDictionary(Dictionary t) {
		return d.save(t)>0;
	}
	/**
	 * 	修改
	 */
	@Override
	public boolean updateDictionary(Dictionary t) {
		
		return d.update(t)>0;
	}
	/**
	 * 	删除
	 */
	@Override
	public boolean deleteDictionaryById(int no) {
		return d.delete(no)>0;
	}
	/**
	 * 	查找全部
	 */
	@Override
	public List<Dictionary> findDictionaryAll() {
		return d.findAll();
	}
	/**
	 * 	通过序号查询
	 */
	@Override
	public Dictionary getById(int no) {
		return d.getById(no);
	}
	/**
	 * 通过TypeID查询
	 */
	public List<Dictionary> findDictionaryByTypeID(TypeID t) {
		return d.findDictionaryByTypeID(t.getId());
	}


}
